import { createRouter, createWebHashHistory } from 'vue-router'
import LoginView from '../views/LoginView.vue'
import LayoutView from '../views/LayoutView.vue'
import WelCome from '../views/home/WelComeView.vue'
import UserView from '../views/system/UserView.vue'
import RoleView from '../views/system/RoleView.vue'
import PermissionView from '../views/system/PermissionView.vue'
import AssociationView from '../views/guild/Association.vue'

const routes = [
   {
    path: '/login',
    name: 'login',
    component: LoginView
  },{
    path:'/',
    name:'首页',
    component:LayoutView,
    redirect: '/home',
    children:[
      {
        path:'/home',
        name:'欢迎页',
        component:WelCome
      },
      {
        path:'/system',
        name:"系统管理",
        mete:{title:"系统管理"},
        children:[
          {
            path:'user',
            name:'用户管理',
            meta:{title:"用户管理"},
            component:UserView
          },{
            path:'role',
            name:'角色管理',
            meta:{title:"角色管理"},
            component:RoleView
          },{
            path:'permission',
            name:'权限管理',
            meta:{title:"权限管理"},
            component:PermissionView
          }
        ]
      },
      {
        path:'/guild',
        name:"协会管理",
        mete:{title:"协会管理"},
        children:[
          {
            path:'association',
            name:"协会信息",
            meta:{title:"协会信息"},
            component:AssociationView
          }
        ]
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router